#ifndef __GCGRAPH_H__
#define __GCGRAPH_H__
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <limits>
#include "./external/graphcut/graph.h"
#include "weights.h"
#include "types.h"

class BaseGraph {
private:
	typedef std::vector<void*> 	line_t;
	typedef std::vector<line_t> nodes_t;

	Graph _oGraph;
	uint _iHeight, _iWidth;
	nodes_t _aNodes;

public:
	BaseGraph(uint iWidth, uint iHeight);
	~BaseGraph();
	void addNode(uint x, uint y, const Weights& w);
	void maxFlow();
	bool isForeground(uint x, uint y) const;
	bool isObject(uint x, uint y) const;
	bool isBackground(uint x, uint y) const;
};

typedef BaseGraph GraphCutGraph;
#endif
